home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / indeo / nwxmas / xmascard.c < prev    next >
Text File  |  1993-12-13  |  1KB  |  61 lines

  1. /*
  2. **    ╔══════════════════════════════════════════════════════════════╗
  3. **    ║                                                              ║
  4. **    ║     Copyright (c) 1993 Digital Video Arts, Ltd.              ║
  5. **    ║                    All Rights Reserved                       ║
  6. **    ║                                                              ║
  7. **    ╚══════════════════════════════════════════════════════════════╝
  8. **
  9. **    Christmas card demo
  10. **
  11. **    file - xmas.c - main program;
  12. */
  13. #include <stdio.h>
  14. #include <fcntl.h>
  15. #include <conio.h>
  16. #include "nw.h"
  17. #include "nwerrno.h"
  18. #include "xmasdemo.h"
  19.  
  20. main(int argc, char **argv)
  21. {
  22.     AvH *a;
  23.     ImH *img;
  24.     Rect r;
  25.     char c;
  26.     int i;
  27.  
  28.     InitNewworld();
  29.     InitDisplays();
  30.     InitImages();
  31.     InitAudio();
  32.     InitAvss();
  33.  
  34.     while(1) {
  35.         if(kbhit()) {
  36.             c = getch();
  37.             break;
  38.         }
  39.         PlayVideo();
  40.         if(PlayAudio()) break;
  41.     }
  42.     AvClose(a);
  43.     _nwerrno = 0;
  44.     if(c == 's') {
  45.         onscreen->dbm.GrPlanes = P_YVU;
  46.         RECT(r, 0, 0, 512, 480);
  47.         img = GrImCompress(&onscreen->dbm, &r, 0l, "NONE", -1L);
  48.         McWait();    /* in case decompressing not done */
  49.         GrImSave(img, &onscreen->dbm, "new");
  50.     }
  51.     NwEnd();
  52. }
  53.  
  54. NwErr(char *cp)
  55. {
  56.     printf("%s\n", cp);
  57.     NwEnd();
  58.     exit(-1);
  59. }
  60.  
  61.